package com.xzp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
public class GirlService {

    @Autowired
    private GirlRepository girlRepository;


    //注意导入的包是org.springframework.transaction.annotation.Transactional
    @Transactional
    public void insertTwo(){
        Girl girlA = new Girl();
        girlA.setAge(20);
        girlA.setCupSize("B");
        girlRepository.save(girlA);

        Girl girlB = new Girl();
        girlB.setAge(19);
        girlB.setCupSize("CC");
        girlRepository.save(girlB);

    }
}
